import axiosInstance from './axiosInstance';

interface RegisterData {
  username: string;
  email: string;
  password: string;
  firstName: string;
  lastName: string;
  phone?: string;
}

interface LoginData {
  email: string;
  password: string;
}

export const authService = {
  register: async (data: RegisterData) => {
    return axiosInstance.post('/auth/register', data);
  },
  
  login: async (data: LoginData) => {
    return axiosInstance.post('/auth/login', data);
  },
  
  getUserProfile: async () => {
    return axiosInstance.get('/auth/me');
  },
  
  updateUserProfile: async (data: Partial<RegisterData>) => {
    return axiosInstance.put('/auth/profile', data);
  }
};